package com.nowar.frame.contxt;

import com.nowar.frame.entity.RequestBodyProxy;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;

import java.lang.reflect.Method;
import java.time.Duration;
import java.util.Map;

/**
 * @Author: 谢无殇。
 * @Date : 2023-01-17 22:56
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class RequestContext {

    /**
     * 服务名
     */
    private String serviceName;
    /**
     * 域名
     */
    private String host;
    /**
     * 路径
     */
    private String url;
    /**
     * 请求参数
     */
    private Map<String, Object> params;
    /**
     * 请求头
     */
    private HttpHeaders headers;
    /**
     * 请求体
     */
    private RequestBodyProxy request;
    /**
     * 连接时间
     */
    private Duration httpConnect;
    /**
     * 请求时间
     */
    private Duration httpTime;
    /**
     * 是否cse请求
     */
    private boolean cse;

    /**
     * 返回值类型
     */
    private Class returnType;
    /**
     * 请求类型
     */
    private HttpMethod httpMethod;
}
